<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>上传文件</title>
</head>
<body>
<h2>文件上传</h2>
<form action="#" th:action="@{/upload}" method="post" enctype="multipart/form-data">
  <label for="username">用户名称</label><input name="username" type="text" id="username"/>
  <br>
  <label  for="upload">选择文件</label>
  <input type="file" id="upload" name="upload" required/>
  <br>
  <input type="submit" value=" 上传文件">
</form>
<div th:if="${message}">
    <p th:text="${message}">消息将显示在此</p>
</div>
</body>
</html>